Skip to content

Move side services out of add-on resourceDefinitions into companion apps; drop privileged (#136) - #137

Merged
DeanKamali merged 1 commit into
mainfrom
dean/issue-136
Oct 20, 2026
Merged

DeanKamali merged 1 commit into
mainfrom
dean/issue-136

Conversation

@DeanKamali

Copy link
Copy Markdown
Contributor

Refs #136 (the "test install" checkbox is still open, so this doesn't close it).

Merging this publishes live. kubero-server reads the catalog from main (raw.githubusercontent.com) for both prod and api-dev, so a merge reaches every zone on the next fetch. None of these six templates has been test-installed yet. Install each on api-dev (shared tier) before merging. Only new installs are affected; existing apps don't change.

Why

n8n, cryptomator, dittofeed, langfuse, posthog and unomi baked extra Deployments, Services or PVCs into an add-on's resourceDefinitions. The server accepts only the add-on's own resource there:

  • on dedicated clusters these templates already fail validation;
  • on the shared tier the extra resources were never created;
  • n8n and unomi also ran privileged: true containers.

How the side services are wired now

Each side service is its own companion app (templateServices, the pattern Supabase, Plane and the n8n worker already use):

  • The main app reaches a companion at http://<nameHint>-{{KUBERO_NAME_SUFFIX}}-kuberoapp on port 80.
  • Companions that need the database set usePrimaryAddons: true.
  • Shared secrets use one {{KUBERO_GEN_ALNUM:n}} env var in both apps.
  • Templates that had no companions now deploy as a group, so the main app is named <name>-api-<suffix>.

Per template

Template Side service → companion Notes
n8n SearXNG → n8n-searxng (pinned 2026.10.17-1c10abe2d, JSON API on) The code sandbox is dropped: it's a Docker-in-Docker runner that can't work without privileged. N8N_INSTANCE_AI_SANDBOX_ENABLED=false; the AI Assistant works without code execution.
cryptomator Keycloak → cryptomator-keycloak The seed realm is passed via env and the admin password is generated. Removed --optimized and KC_HOSTNAME_BACKCHANNEL_DYNAMIC (Keycloak 26 refuses it without a hostname). The Hub's database credentials now use the injected $(PGUSER)/$(PGPASSWORD).
dittofeed Temporal → dittofeed-temporal (temporalio/auto-setup:1.22.4) It connects with the injected PG variables instead of the superuser with a literal password, and uses separate temporal/temporal_visibility databases (the app user gets CREATEDB).
langfuse MinIO → langfuse-minio (5Gi volume) A generated LANGFUSE_MINIO_PASSWORD replaces changeme.
posthog Redpanda → posthog-kafka (v25.1.9) The old setup never worked: it advertised posthog-kafka:9092, but the Service was named <app>-kafka.
unomi Elasticsearch → unomi-elasticsearch (9.1.3, single-node, mmap off, 256m heap, 2Gi) The privileged sysctl and root chown init containers are gone. The fake "Elasticsearch" add-on (really an unused Valkey) is removed.

Validation

  • Copy of the server's rules: on main only these 6 templates fail; on this branch 0 of 301 files fail. No other template violates.
  • The real server code: kubero-server dev's validateAddonResourceDefinitions and appSecurityContextViolations, run against every template, companions included: main fails 6 of 300, this branch 0 of 300.
  • Repo scripts: lint-template-addons.py passes. migrate-to-communal-db-env.py --check reports the same 6 known failures as before (none added).

Known gaps (filed separately)

  • Sizing: companions get the default "small" size, which is probably too little for Keycloak and Elasticsearch.
  • cryptomator: needs a separate keycloak database, and HUB_KEYCLOAK_PUBLIC_URL must be set after deploy.
  • dittofeed: Temporal needs CREATEDB, which shared zones may not allow.
  • langfuse and posthog: are still missing their worker apps.

kubero-server only accepts add-on catalog kinds (plus Secret/ConfigMap) in
addons[].resourceDefinitions and refuses host-access fields, so these
templates failed validation on dedicated clusters and their side services
never ran on the shared tier. Each side service is now its own
templateServices companion app, reached as
<nameHint>-{{KUBERO_NAME_SUFFIX}}-kuberoapp on port 80 and, where it needs
the database, bound to the primary's add-ons with usePrimaryAddons.

- n8n: SearXNG becomes the n8n-searxng companion (writes a settings.yml
  that enables the JSON API). The code sandbox (privileged Docker-in-Docker
  runner) is dropped and N8N_INSTANCE_AI_SANDBOX_ENABLED is false.
- cryptomator: Keycloak becomes the cryptomator-keycloak companion (seed
  realm passed as an env var, PG contract env, generated admin password);
  Hub datasource credentials use $(PGUSER)/$(PGPASSWORD).
- dittofeed: Temporal becomes the dittofeed-temporal companion on the PG
  contract (no superuser literal); the CNPG role gets CREATEDB.
- langfuse: MinIO becomes the langfuse-minio companion on a volume, with a
  generated root password shared with Langfuse.
- posthog: Redpanda becomes the posthog-kafka companion.
- unomi: Elasticsearch becomes the unomi-elasticsearch companion without
  the privileged sysctl / chown init containers (single-node, mmap off);
  the placeholder Valkey add-on that carried it is removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants